package com.jianbing.util;

import com.alibaba.fastjson.JSONObject;
import com.jianbing.entity.City;
import com.jianbing.entity.GjjCity;

/**
 * Created by hantixiang on 12/1/2016.
 */
public class CityHelper {
    public static final int NORMAL = 1, MAINTAIN = -1, DIAOYU = 2, NOT_SUPPORT = 0, ZHIYUANZHE = 3; //正常，维护，钓鱼，不支持,志愿者

    public static JSONObject checkGjjCityStatus(GjjCity city) {
        JSONObject jsonObjectResult = new JSONObject();
        if (city == null) {
            jsonObjectResult.put("Code", -1);
            jsonObjectResult.put("Msg", "城市不存在");
            return jsonObjectResult;
        }
        if (city.getState() == CityHelper.MAINTAIN) {
            jsonObjectResult.put("Code", 107);
            jsonObjectResult.put("Msg", "该城市在维护中!");
            return jsonObjectResult;
        }

        if (city.getState() == CityHelper.NOT_SUPPORT) {
            jsonObjectResult.put("Code", 107);
            jsonObjectResult.put("Msg", "该城市不支持!");
            return jsonObjectResult;
        }

        return null;
    }
}
